'\" te
.\" Copyright (c) 2006, Sun Microsystems, Inc.  All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH SDP 4D "June 19, 2021"
.SH NAME
sdp \- Sockets Direct Protocol driver
.SH SYNOPSIS
.nf
#include <sys/socket.h>
.fi

.LP
.nf
#include <netinet/in.h>
.fi

.LP
.nf
\fBs = socket(AF_INET, SOCK_STREAM, PROTO_SDP);\fR
.fi

.LP
.nf
\fBs = socket(AF_INET6, SOCK_STREAM, PROTO_SDP);\fR
.fi

.SH DESCRIPTION
The Sockets Direct Protocol (\fBSDP\fR) is a transport protocol layered over
the \fIInfiniband Transport Framework\fR (\fBIBTF\fR). \fBSDP\fR is a standard
implementation based on Annex 4 of the \fIInfiniband Architecture Specification
Vol 1\fR and provides reliable byte-stream, flow controlled two-way data
transmission that closely mimics the Transmission Control Protocol (\fBTCP\fR).
.sp
.LP
\fBSDP\fR supports a sockets-based SOCK_STREAM interface to application
programs. It also supports graceful close (including half-closed sockets), IP
addressing (IPv4 or IPv6), the connecting/accepting connect model, out-of-band
(OOB) data and common socket options. The \fBSDP\fR protocol also supports
kernel bypass data transfers and data transfers from send-upper-layer-protocol
(ULP) buffers to receive ULP buffers. A \fBSDP\fR message includes a BSDH
header followed by data. (A BSDH header advertises the amount of available
buffers on the local side).
.sp
.LP
\fBSDP\fR networking functionality is broken into the \fBsdp\fR driver and a
function call-based sockfs implementation. A new protocol family of PROTO_SDP
is introduced to use the \fBSDP\fR transport provided by the driver.
.sp
.LP
Sockets utilizing \fBSDP\fR are either active or passive. Active sockets
initiate connections to passive sockets. Both active and passive sockets must
have their local IP or IPv6 address and \fBSDP\fR port number bound with the
\fBbind\fR(3SOCKET) system call after the socket is created. By default,
\fBSDP\fR sockets are active. A passive socket is created by calling the
\fBlisten\fR(3SOCKET) system call after binding the socket with bind(). This
process establishes a queueing parameter for the passive socket. Connections to
the passive socket can be received with the \fBaccept\fR(3SOCKET) system call.
Active sockets use the \fBconnect\fR(3SOCKET) call after binding to initiate
connections.
.sp
.LP
In most cases, \fBSDP\fR sends data when it is presented. When outstanding
data is not yet acknowledged, \fBSDP\fR gathers small amounts of output to be
sent in a single packet once an acknowledgement is received. For a small
number of clients this packetization may cause significant delays. To
circumvent this problem, \fBSDP\fR provided by the driver supplies
SDP_NODELAY, a socket-level boolean option. Note that this behavior is similar
to the TCP_NODELAY option.
.sp
.LP
\fBSDP\fR provides an urgent data mechanism that can be invoked using the
out-of-band provisions of \fBsend\fR(3SOCKET). The out-of-band delivery
behavior is identical to TCP. The caller may mark one byte as "urgent" with the
MSG_OOB flag to \fBsend\fR(3SOCKET). This sets an "urgent pointer" pointing to
the byte in the \fBSDP\fR stream. The receiver of the stream is notified of the
urgent data by a \fBSIGURG\fR signal. The SIOCATMARK \fBioctl\fR(2) request
returns a value indicating whether the stream is at the urgent mark. Because
the system never returns data across the urgent mark in a single \fBread\fR(2)
call, it is possible to advance to the urgent data in a simple loop which reads
data, testing the socket with the \fBSIOCATMARK\fR ioctl() request until it
reaches the mark.
.SH ADDRESS FORMATS
\fBSDP\fR uses IP/IPv6 addresses to refer to local and remote devices and
opens a reliable connected IB connection between two end points. The \fBsdp\fR
driver supports a point-to-point connection, however broadcasting and
multicasting are not supported.
.SH SOCKET OPTIONS
\fBSDP\fR supports setsockopt and getsockopt to set and read socket options.
Very few socket options affect \fBSDP\fR protocol operations. Other common
socket options are processed but do not affect SDP protocol operation. All
socket options are checked for validity. A getsockopt returns the values set or
toggled by setsockopt. Socket options that affect protocol operations are
SO_LINGER, SO_DEBUG, SO_REUSEADDR and SO_OOBINLINE.
.SH ERRORS
.ne 2
.na
\fB\fBEISCONN\fR\fR
.ad
.RS 28n
A connect() operation was attempted on a socket on which a connect() operation
had already been performed.
.RE

.sp
.ne 2
.na
\fB\fBECONNRESET\fR\fR
.ad
.RS 28n
The remote peer forced the connection to be closed. This usually occurs when
the remote machine loses state information about the connection due to a crash.
.RE

.sp
.ne 2
.na
\fB\fBECONNREFUSED\fR\fR
.ad
.RS 28n
The remote peer actively refused connection establishment. This usually occurs
because no process is listening to the port.
.RE

.sp
.ne 2
.na
\fB\fBEADDRINUSE\fR\fR
.ad
.RS 28n
A bind() operation was attempted on a socket with a network address/port pair
that has already been bound to another socket.
.RE

.sp
.ne 2
.na
\fB\fBEADDRNOTAVAIL\fR\fR
.ad
.RS 28n
A bind() operation was attempted on a socket with a network address for which
no network interface exists.
.RE

.sp
.ne 2
.na
\fB\fBEACCES\fR\fR
.ad
.RS 28n
A bind() operation was attempted with a reserved port number and the effective
user ID of the process was not the privileged user.
.RE

.sp
.ne 2
.na
\fB\fBENOBUFS\fR\fR
.ad
.RS 28n
The system ran out of memory for internal data structures.
.RE

.SH FILES
.ne 2
.na
\fB\fB/kernel/drv/amd64/sdp\fR\fR
.ad
.sp .6
.RS 4n
64-bit \fBELF\fR kernel module (x86).
.RE

.sp
.ne 2
.na
\fB\fB/kernel/drv/sparcv9/sdp\fR\fR
.ad
.sp .6
.RS 4n
64-bit \fBELF\fR kernel module (SPARC).
.RE

.sp
.ne 2
.na
\fB\fB/kernel/drv/amd64/sdpib\fR\fR
.ad
.sp .6
.RS 4n
64-bit \fBELF\fR kernel module (x86).
.RE

.sp
.ne 2
.na
\fB\fB/kernel/drv/sparcv9/sdpib\fR\fR
.ad
.sp .6
.RS 4n
64-bit \fBELF\fR kernel module (SPARC).
.RE

.SH ATTRIBUTES
See \fBattributes\fR(7) for descriptions of the following attribute:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Architecture	x86, SPARC
.TE

.SH SEE ALSO
.BR read (2),
.BR socket.h (3HEAD),
.BR accept (3SOCKET),
.BR bind (3SOCKET),
.BR connect (3SOCKET),
.BR send (3SOCKET),
.BR getsockopt (3XNET),
.BR attributes (7),
.BR standards (7)
.sp
.LP
\fIInfiniband Architecture Specification Vol 1- Annex 4\fR \(em November, 2002
